<template>
  <div>
    <el-button @click="regGet"> get请求</el-button>
    <el-button @click="reqGoods"> get请求商品</el-button>
    <el-button @click="addGoods"> add请求商品</el-button>
    <el-button @click="updateGoods"> update请求商品</el-button>
    <el-button @click="deleteGoods"> delete请求商品</el-button>

    <el-button @click="userlist"> userlist</el-button>
    <el-button @click="shoplist"> shoplist</el-button>

    <el-button @click="userallList">userallList</el-button>
  </div>
</template>
  
<script>
import axios from 'axios';
export default {
  name: 'projectManagement',
  componentTitle: '专题管理',
  data () {
    return {}
  },
  methods:{
    regGet(){
      console.log('13');
      axios({
        url:'http://127.0.0.1:3000/',
        method:'get',
        params:{
          pageIndex:1,
          pageSize:10,
        },
      }).then(res=>{
        console.log(res);
      })
    },
    reqGoods(){
      axios({
         url:'http://127.0.0.1:3000/goods/list',
        method:'get',
      }).then(res=>{
        console.log('goods/list',res);
      })
    },
    addGoods(){
      axios({
         url:'http://127.0.0.1:3000/goods/add',
        method:'post',
      }).then(res=>{
        console.log('goods/add',res);
      })
    },
    updateGoods(){
      axios({
         url:'http://127.0.0.1:3000/goods/update',
        method:'put',
        data:{
          name:'100'
        }
      }).then(res=>{
        console.log('goods/update',res);
      })
    },
    deleteGoods(){
      axios({
         url:'http://127.0.0.1:3000/goods/delete',
        method:'delete',
      }).then(res=>{
        console.log('goods/delete',res);
      })
    },
    userlist(){
      axios({
         url:'http://127.0.0.1:3000/users/list',
        method:'get',
      }).then(res=>{
        console.log('user/list',res);
      })
    },
    shoplist(){
      axios({
         url:'http://127.0.0.1:3000/shop/list',
        method:'get',
      }).then(res=>{
        console.log(res);
      })
    },

    
    userallList(){
      axios({
         url:'http://127.0.0.1:3000/users/set',
        method:'put',
      }).then(res=>{
        console.log(res);
      })
    },
  }
}
</script>
